package com.jichangxiu.generator.action;

import com.jichangxiu.common.entity.vo.PageResult;
import com.jichangxiu.generator.entity.dto.query.QueryGenColumn;
import com.jichangxiu.generator.service.GenColumnService;
import com.jichangxiu.framework.action.BaseAction;
import com.jichangxiu.common.annotation.*;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.springdoc.api.annotations.ParameterObject;
import org.springframework.security.access.prepost.PreAuthorize;

import javax.annotation.Resource;

/**
 * GenColumnAction:
 *
 * @author JiChangXiu
 * @create 2024-06-30 13:31:02
 */
@Slf4j
@Rest("/generator/column")
@Tag(name = "生成列控制器")
public class GenColumnAction extends BaseAction {

    @Resource
    private GenColumnService genColumnService;

    /**
     * （可分页）查询生成列列表
     *
     * @param queryGenColumn 查询视图对象
     * @return （分页）生成列列表
     */
    @Get("/lists")
    @Operation(summary = "（可分页）查询生成列列表")
    @PreAuthorize("@jcx.hasPower('generator:column:lists')")
    public PageResult lists(@ParameterObject QueryGenColumn queryGenColumn) {
        return pageResult(genColumnService.lists(queryGenColumn));
    }

}